package com.xin.uploadanddownload.test;

import org.junit.Test;

import java.io.*;

public class IOEx {
    public static void main(String[] args) throws IOException {
        /**
         * java.io.FileNotFoundException: E:\Seeyon\A8\base\temporary\3171475702840443981D1702861881967 (拒绝访问。)
         * 	at java.io.FileInputStream.open0(Native Method) ~[?:1.8.0_282]
         * 	at java.io.FileInputStream.open(FileInputStream.java:195) ~[?:1.8.0_282]
         * 	at java.io.FileInputStream.<init>(FileInputStream.java:138) ~[?:1.8.0_282]
         */
        /**
         *  1. 这个路径如果是文件夹，然后去文件夹中写入数据，就会出现拒绝访问
         *  2. 如果文件没有权限也会出现文件拒绝访问
          */
        String path="D:\\Seeyon33\\A8\\base\\temporary1\\3171475702840443981D1702861881967";
        File file = new File(path);
        file.mkdirs();
//        file.delete();
        FileOutputStream fileOutputStream = new FileOutputStream(file);
//        fileOutputStream.write(97);
    }




    public static void main1(String[] args) throws Exception {
        /*
            Exception in thread "main" java.io.FileNotFoundException: D:\Seeyon\A8\base\temporary1\3171475702840443981D1702861881967 (拒绝访问。)
	 at java.base/java.io.FileInputStream.open0(Native Method)
	 at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	 at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	 at com.xin.uploadanddownload.test.IOEx.main(IOEx.java:29)
         */
        String path="D:\\Seeyon1\\A8\\base\\temporary1\\3171475702840443981D1702861881967";
        File file = new File(path);
//        file.mkdirs();
        FileInputStream fileInputStream = new FileInputStream(file);
//        fileInputStream.read();

    }
    @Test
    public void method() throws Exception{
        String path="D:\\Seeyon888\\A8\\base\\temporary1\\3171475702840443981D1702861881967";
        File file = new File(path);
//        boolean delete = file.delete();
//        System.out.println(delete);
        file.mkdirs();
        file.delete();
//        file.getParentFile().mkdirs();
//        file.createNewFile();
//        FileInputStream fileInputStream = new FileInputStream(file);
//        fileInputStream.read();
    }

}
